﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;


namespace ATM
{
    public partial class deposit : Form
    {
        AccountLogic ca = new AccountLogic();
        //AccountDB d = new AccountDB();
        public string accountnum, accou, t;
       // float num, num2, result;
        
        public deposit(string acc)
        {
            InitializeComponent();
            accountnum = acc;
        }

        public void Deposit_Balance_Click(object sender, EventArgs e)//deposit
        {
           accou = accountnum;
            ca.deposcall(textBox1.Text, accou);

            if (ca.ch == 1)
            {
                if (ca.checkforBAL == 1)
                {
                    this.Hide();
                    inter_face frm = new inter_face(accou);
                    frm.Show();
                }
                else
                {
                    MessageBox.Show("The balance can not be less than 10 or more than 10000");
                    textBox1.Clear();
                }
            }
            else
            {
                MessageBox.Show("It must be a positive Numeric value");
                textBox1.Clear();
            }
          
        }

       
        private void numbers_Click(object sender, EventArgs e)
        {
            Button b = (Button)sender;
            textBox1.Text = textBox1.Text + b.Text;
        }

        private void Clear_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
        }

        private void exit_Click(object sender, EventArgs e)
        {
            welcom w = new welcom();
            w.Show();
            this.Hide();
        }

        private void back_Click(object sender, EventArgs e)
        {
            inter_face inter = new inter_face(accountnum);
            inter.Show();
            this.Hide();
        }
    }
}
